<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .div1 {
            height: 400px;
            width: 400px;
            background-color: plum;
            /*相对定位*/
            /*position: relative;*/
            /*left: 100px;*/
            /*top: 100px;*/
            /*padding-top: 100px;*/
        }
        .div2{
            height: 100px;
            width: 100px;
            background-color: #09E0B5;
            /* 行高 */
            line-height: 100px;
            text-align: center;
            /*position: relative;*/
            /*position: absolute;*/
            /*top: 100px;*/
        }
        * {
            margin: 0;
            padding: 0;
        }

        #div_1 {
            float: left;
        }

        #div_2 {
            float: right;
        }

        #div_3 {
            position: absolute;
            top: 300px;
        }

        #div_4 {
            position: absolute;
            top: 300px;
            left: 300px;
        }
    </style>
</head>
<body>
    <div class="div1">
        <div class="div2" id="div_1">1</div>
        <div class="div2" id="div_2">2</div>
        <div class="div2" id="div_3">3</div>
        <div class="div2" id="div_4">4</div>
    </div>
    <!--  三种定位  -->
    <!--  相对定位  参照物是自己  -->
    <!--  绝对定位  参照物是有定位的父级  -->
    <!--  固定定位  参照物是浏览器边框  -->
</body>
</html>